package com.xly.webclick.databinding;

import android.databinding.BindingAdapter;
import android.widget.ImageView;

import com.bumptech.glide.Glide;

/**
 * Created by xuleyuan on 2018/8/19
 */

public class ImageViewAdapter {

    @BindingAdapter({"imgRes"})
    public static void setImageDrawable(ImageView imageView, int drawableRes) {
        if (drawableRes != 0) {
            Glide.with(imageView.getContext())
                    .load(drawableRes)
                    .into(imageView);
        }
    }
}
